import { useEffect, useRef, useState } from 'react'; 
import http from '../utils/http';
const Fukuan = () => {
    let alipayForm = useRef();

  return(
    <div>
        <>
      <div ref={alipayForm}></div>
      <button onClick={async() => {
        let res= await http.post('/alipay',{
          outTradeNo:Date.now(),
          subject:'测试商品',
          totalAmount:10
        })
        alipayForm.current.innerHTML = res.data
        document.forms[0].submit()

      }}>
        支付
      </button>
    </>
    </div>
  )
}
export default Fukuan